package com.example.task1.ui.AllService.YouthStation;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class YouthStationAdapter extends FragmentPagerAdapter {

    public List<String> title;

    public List<Fragment> data;

    public YouthStationAdapter(@NonNull FragmentManager fm,List<String> title,List<Fragment> data) {
        super(fm);
        this.title = title;
        this.data = data;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return data.get(position);
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return title.get(position);
    }
}
